<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'main';
$worker = pdo_get('jy_wxshifu_member',array('uniacid'=>$_SESSION['uniacid'],'mid'=>$_SESSION['uid']));
if(empty($worker)){
	exi('您不是师傅！','error','/apply/');
}
if($_RQ['op']=='main'){
	$return['list']=array();
	$return['params']['status']=0;
	exi($return);
}
if($_RQ['op']=='list'){	
	$params=array('uniacid'=>$_SESSION['uniacid'],'shifuid'=>$worker['id']);
	$status=intval($_RQ['status']);
	$params['status']=$status;
	$page=intval($_RQ['page']);
	if(!$page){
		$page=1;
	}
	$limit=array($page,10);
	$list=pdo_getslice('jy_wxshifu_orderlog',$params,$limit,$total,'','','id desc');
	if($list){
		foreach($list as &$item){
			$item['createtime']=date('Y/m/d H:i:s',$item['createtime']);
			$item['is_addtitle']=$item['is_add']?'获得':'消费';
			$item['remark']='获得：'.$item['get_price'].'元，异常扣除：'.$item['get_price']-$item['get_money'].'元，最终结算：'.$item['get_money'];
			if($item['status']==0){
				$item['statustitle']='未结算';
			}elseif($item['status']==1){
				$item['statustitle']='结算中';
			}else{
				$item['statustitle']='已结算';
			}
		}
	}
	$return['list']=$list;
	exi($return);
}